/*
 * ------------------------------------------------------------------
 * 封装document操作 模块
 * ------------------------------------------------------------------
 * exitFullscreen ： 退出全屏
 * launchFullscreen ： 进入全屏
 * clipboard : 拷贝文本到剪贴板
 * ------------------------------------------------------------------
 * @关于我：
 * QQ:2815473064
 * wechat:13531609457
 * ------------------------------------------------------------------
 */

// 退出全屏
export const exitFullscreen = () => {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.msExitFullscreen) {
    document.msExitFullscreen();
  } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
  } else if (document.webkitExitFullscreen) {
    document.webkitExitFullscreen();
  }
};
// 进入全屏
export const launchFullscreen = () => {
  let element = document.documentElement;
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if (element.msRequestFullscreen) {
    element.msRequestFullscreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullScreen();
  }
};
export const clipboard = (value) => {
  document.writeText(value);
};
export default {
  launchFullscreen,
  exitFullscreen,
  clipboard,
};
